package com.ilink.ilinkapi.client;
/**
 * <h3>ilink-java-backend</h3>
 *
 * @Description <p>用户基础服务远程调用</p>
 * @Author Black Curry
 * @Date 2024-09-17 09:11
 **/

import com.ilink.ilinkapi.dto.user.UserDTO;
import com.ilink.ilinkcommon.domain.R;
import java.util.List;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

/**
 * @ClassName UserServiceClient
 * @Description 用户基础服务 允许微服务内部通信访问的接口
 * @Author Black Curry
 * @Date 2024-09-17 09:11
 **/
@FeignClient(name = "user-service", path = "/user")
public interface UserServiceClient {

    @PutMapping("/update_user_image")
    R updateUsermeta(
        @RequestParam(required = false) MultipartFile userCover,
        @RequestParam(required = false) MultipartFile userImage);

    @GetMapping("/load_user_meta")
    R loadUserMeta(@RequestParam List<String> userIds);

    @GetMapping("/whoami")
    R whoami(@RequestParam("userId") String userId);


    // 写入个人资料
    @PutMapping("/update_usermeta")
    R updateUsermeta(@RequestBody UserDTO userMetaResponse);

    @GetMapping("/get_usermeta")
    R getUserMeta();

    @GetMapping("/search_user_by_name")
    R searchUserByRealName(@RequestParam("query") String query);

    @GetMapping("/check_user_scene_permission")
    R checkUserScenePermission(@RequestParam("userId") String userId,
        @RequestParam(value = "sceneId", required = false) Long sceneId);
}

